{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1 安装Shenma自定义库\n",
    "\n",
    "一个用于“神码童学”人工智能教学的自定义库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://pypi.doubanio.com/simple\n",
      "Requirement already satisfied: Shenma in c:\\programdata\\anaconda3\\lib\\site-packages (0.1.1)\n",
      "Requirement already satisfied: numpy>=1.14.0 in c:\\programdata\\anaconda3\\lib\\site-packages (from Shenma) (1.14.0)\n",
      "Requirement already satisfied: baidu-aip>=2.2.18.0 in c:\\programdata\\anaconda3\\lib\\site-packages (from Shenma) (2.2.18.0)\n",
      "Requirement already satisfied: matplotlib>=2.1.2 in c:\\programdata\\anaconda3\\lib\\site-packages (from Shenma) (2.1.2)\n",
      "Requirement already satisfied: PyAudio>=0.2.11 in c:\\programdata\\anaconda3\\lib\\site-packages (from Shenma) (0.2.11)\n",
      "Requirement already satisfied: requests in c:\\programdata\\anaconda3\\lib\\site-packages (from baidu-aip>=2.2.18.0->Shenma) (2.23.0)\n",
      "Requirement already satisfied: six>=1.10 in c:\\programdata\\anaconda3\\lib\\site-packages (from matplotlib>=2.1.2->Shenma) (1.11.0)\n",
      "Requirement already satisfied: python-dateutil>=2.1 in c:\\programdata\\anaconda3\\lib\\site-packages (from matplotlib>=2.1.2->Shenma) (2.6.1)\n",
      "Requirement already satisfied: pytz in c:\\programdata\\anaconda3\\lib\\site-packages (from matplotlib>=2.1.2->Shenma) (2017.3)\n",
      "Requirement already satisfied: cycler>=0.10 in c:\\programdata\\anaconda3\\lib\\site-packages (from matplotlib>=2.1.2->Shenma) (0.10.0)\n",
      "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\\programdata\\anaconda3\\lib\\site-packages (from matplotlib>=2.1.2->Shenma) (2.2.0)\n",
      "Requirement already satisfied: idna<3,>=2.5 in c:\\programdata\\anaconda3\\lib\\site-packages (from requests->baidu-aip>=2.2.18.0->Shenma) (2.6)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in c:\\programdata\\anaconda3\\lib\\site-packages (from requests->baidu-aip>=2.2.18.0->Shenma) (2018.4.16)\n",
      "Requirement already satisfied: chardet<4,>=3.0.2 in c:\\programdata\\anaconda3\\lib\\site-packages (from requests->baidu-aip>=2.2.18.0->Shenma) (3.0.4)\n",
      "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\\programdata\\anaconda3\\lib\\site-packages (from requests->baidu-aip>=2.2.18.0->Shenma) (1.22)\n"
     ]
    }
   ],
   "source": [
    "!pip install Shenma"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2 导入自定义库\n",
    "Shenma库为用于人工智能的自定义库，其中Shenma.sound中包含了可以实现声音录制、播放、可视化等操作的方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from Shenma.sound import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3 设定参数\n",
    "- filepath：保存路径及名称\n",
    "- RECORD_SECONDS：录制时长"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "filepath = 'test.wav'\n",
    "RECORD_SECONDS = 5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4 声音录制\n",
    "利用**get_audio(filepath, RECORD_SECONDS)**函数，可以实现声音的录制\n",
    "\n",
    "默认录制的音频参数：\n",
    "- 声道：双声道\n",
    "- 采样率：16000Hz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "是否开始录音？ （是/否）是\n",
      "********** 开始录音：请在5秒内输入语音\n",
      "********** 录音结束\n",
      "\n"
     ]
    }
   ],
   "source": [
    "get_audio(filepath, RECORD_SECONDS)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 5 声音播放\n",
    "利用play(filepath)函数，可以实现声音的播放"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "开始播放\n",
      "该音频的时长为5秒\n",
      "播放结束\n"
     ]
    }
   ],
   "source": [
    "play(filepath)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 6 声音可视化\n",
    "利用sound_draw(filepath)函数，可以实现声音可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEKCAYAAADq59mMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl4XVW9//H3t0nnGRo6Q6GEoe2tgKGAFUUKtAyX1nsRQcT+AC8K1AcEZbjKpKKoCOpFUASUKo+VQZmhVCijtDSFtlBKaSiFhkKb0nlM0nx/f5ydcJKcYZ9h5zQ5n9fz5OGctdde+3u0yfestfZey9wdERGRTHQqdAAiItL+KHmIiEjGlDxERCRjSh4iIpIxJQ8REcmYkoeIiGRMyUNERDKm5CEiIhlT8hARkYyVFjqAqAwYMMBHjBhR6DBERNqV+fPnr3X3snT1OmzyGDFiBJWVlYUOQ0SkXTGz98PU07CViIhkTMlDREQypuQhkqWXq9Yy4srHGXHl43ltd3vtLkZc+Tj3zVuZUzsX3ju/Kb5/v7s2T9GJxCh5SFH6d9VaPvhkW05tnHXn3DxF09zB1zwFwOUPLsq6je21u3jijY+b3v/8qaU5xyUSr8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2hctfeEoM3GYbO+QDmxP/x/cvdtAO6+zsz6Av3c/fmg7j3A/XHtN7Y5HxgRvP4C8NugjUXBOlYAy4H9zOz/gMeBp+PaWQMMSfQ/jEgqSh5S7HbGvW6Ie99A7PejE7ChseeSwnZiyQAAd/920Es5GVhgZocQ2y/mO+4+M/5EM5tE5vvGNMa5i+a/x63acff1ZvYZYCJwEXA6cG5wuFsQu0hGNOchHd1moHe2JwebRL1nZl+B2HLuwR/ilpYA+ze+MbOR7j7X3a8B1hLbJ2YmcEGwlwhmdkCwbPbTwLlm1iMo38PdNwLrG+cziK0C/DypvQCcFbQxBhgbvB4AdHL3B4GrgcPizjmAiJbslo5NPQ/p0Nz9EzN7OZgkfxL4XRbNnAXcbmY/JLb39wxgYYs6LwC/MjPz2FLVvzSzcmK9jWeC+ouIDTG9FuwpUgNMcfengp5JpZnVAk8A/wtMBX4fJJXlwDlp4rwd+FMwXLWA2JLcENtK+U9m1vhl8Spo2hBrf6Ay0/9BRLQku0iemNlvgEfd/V+FjiUMM/sycJi7X13oWKT90bCVSP78FOhR6CAyUAr8qtBBSPuknoeIiGRMPQ8REcmYkoeIiGRMyUNERDKm5CEiIhlT8hARkYz9f8qwqTyinucZAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2349c7b9e10>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sound_draw(filepath)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "上下两幅图对应音频的两个声道：\n",
    "- 纵坐标表示频率\n",
    "- 横坐标代表时间"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
